package com.xuhuan.example.example038;

import com.xuhuan.example.util.ExampleArrayUtils;

/**
 * @author: huan.xu
 * @create: 2023/11/13 17:43
 * @description:
 **/
public class Example038 {
    public static void main(String[] args) {
        int[] array = {63, 4, 24, 1, 3, 15};
        System.out.println("排序前数组：");
        ExampleArrayUtils.printArray(array);
        for (int i = 1; i < array.length; i++) {
            for (int j = 0; j < array.length - i; j++) {
                if (array[j] > array[j + 1]) {
                    int tmp = array[j];
                    array[j] = array[j + 1];
                    array[j + 1] = tmp;
                }
            }
        }
        System.out.println();
        System.out.println("排序后数组：");
        ExampleArrayUtils.printArray(array);
    }
}
